<template>
  <el-container style="height: 100%; border: 1px solid #eee">
<!--    <div>
      <input type="button" value="获取远程数据" @click="sendReq()">
    </div>-->
    <el-aside :width="aside_with" style="background-color: rgb(238, 241, 246)">
      <Aside :isCollapse="isCollapse"></Aside>
    </el-aside>

    <el-container>

      <el-header style="text-align: right; font-size: 12px;border-bottom:darkgray 1px solid ">
        <Header @doCollapse="doCollapse" :icon="icon"></Header>
      </el-header>

      <el-main style="height: 100%">
        <Main></Main>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Aside from "./Aside";
import Header from "./Header";
import Main from "./Main";


export default {
  name: "Index",
  components: {Main, Header, Aside},
  data() {
    return {
      isCollapse: false,
      aside_with: '200px',
      icon:'el-icon-s-fold'

    }
  },
  methods: {
    doCollapse() {
      console.log('doCollapse')
      this.isCollapse = !this.isCollapse
      if (!this.isCollapse) {
        //展开
        this.aside_with = '200px'
        this.icon='el-icon-s-fold'
      } else {
        //关闭 收起
        this.aside_with = '64px'
        this.icon='el-icon-s-unfold'
      }
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}

.el-admin {
  padding: 5px;
}

.el-aside {
  color: #333;
}
</style>
